@mixin dashedBorder {
  border: 0.2rem dashed var(--divider-color);
  padding: 1rem;
  width: 98%;
}

@mixin removeBorder {
  border: initial;
  padding: initial;
}

@mixin innerdashedBorder {
  border: 0.2rem dashed var(--divider-color);
  padding: 0.5rem;
}

@mixin scollBarStyle {
  &::-webkit-scrollbar {
    width: 0.4rem;
  }
  &::-webkit-scrollbar-thumb {
    background-color: var(--scroll-scrollbar);
    border-radius: 0.2rem;
  }
  &::-webkit-scrollbar-track {
    background-color: var(--scroll-track);
  }
}

// 预览
.preveiw{
  .model { 
    padding:unset;
    background-color: unset;
    &-header{
      display: flex;
      justify-content: space-between;
      margin-bottom: 1rem;
    }
    //名称
    &-name{
      &-input{
        font-size: 24px;
      }
    }
    //swiper
    &-swiper{
      @include removeBorder;
      width: 98%;
    }
    //table
    &-table{
      @include removeBorder;
    }
    //operate
    &-operate{
      @include removeBorder;
    }
  }
}

.model { 
  width: 100%;
  height: calc(100vh - 10rem) !important;
  box-sizing: border-box;
  padding: 1% 25%;
  background-color: rgb(169, 182, 181);
  overflow-y: auto;

  .el-form-item{
    width: 100%;
  }

  /* 模板名称 */
  &-title {
    display: flex;
    align-items: center;
    .el-form-item__label{
      width: 100px;
    }
  }
  /* 模板详情 */
  &-detail {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    padding: 1rem;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;

    &-bottom{
      display: flex;
      flex-direction: row;
      justify-content: flex-end;
      gap: 1rem;
      width: 100%;
      font-size: 14px;
      &-item{
        display: flex;
        flex-direction: column;
        align-items: center;
        &-icon{
          width: 1.5rem;
          height: 1.5rem;
        }
      }
    }
  }
  /* operate */
  &-operate {
    cursor: pointer;
    @include dashedBorder();

    &-title {
      font-size: var(--font-title-size);
      &-hint{
        color: var(--font-hint-color);
      }
    }

    &-nodata {
      display: flex;
      justify-content: center;
      align-items: center;
      &-icon {
        width: 1rem;
        height: 1rem;
      }
    }

    //步骤二 右侧子组件
    &-form {
      box-sizing: border-box;
      // background-color: aqua;
      &-item {
        padding: 1.2rem;
        box-sizing: border-box;
        align-items: center;
        &-list + &-list {
          margin-top: 10px;
        }
        &-list {
          display: flex;
          width: 100%;
          align-items: center;
          padding: 0 1rem;
          box-sizing: border-box;
          background-color: var(--divider-color);
          &-left {
            display: flex;
            text-align: left;
            flex-direction: column;
            flex: 3;
            &-title {
              font-weight: bold;
            }
            &-remark {
              color: var(--font-hint-color);
            }
          }
          &-right {
            flex: 1;
          }
        }
        &-select{
          padding: 5px;
          text-align: center;
          &:hover{
            color: var(--primary-main-color);
          }
        }
        &-img {
          width: 5rem;
          height: 5rem;
          position: relative;
          &:hover {
            &::after{
              position: absolute;
              left: 0;
              top: 0;
              display: flex;
              align-items: center;
              justify-content: center;
              content: '更换';
              color: white;
              // background-color: rgba(0, 0, 0, 0.144);
              background-color: var(--main-mask-color);
              width: 100%;
              height: 100%;
            }
          }
        }
      }
      &-special {
        display: flex;
        flex-direction: column;
        .el-form-item__label {
          width: 100% !important;
        }
        &-icon {
          color: var(--primary-main-color);
          margin-left: 1rem;
          cursor: pointer;
        }
      }
    }

    //步骤二 全局
    &-table {
      display: flex;
      gap: 0.1rem;
      background-color: var(--divider-color);
      box-sizing: border-box;
      padding: 1rem;
      height: 30rem;
      margin: 2rem 0;
      overflow-y: auto;
      /* 左侧 */
      &-left {
        flex: 2;
        height: 100%;
        overflow-y: auto;
        background-color: white;
        box-sizing: border-box;
        padding: 0.8rem;
        @include scollBarStyle();

        .item-checked {
          box-shadow: inset 0 0 0 0.2rem var(--primary-main-color);
        }
        /* list样式 */
        &-item {
          display: flex;
          align-items: center;
          position: relative;
          padding: 0.5rem 1rem;
          margin-bottom: 0.5rem;

          &-del {
            width: 1.3rem;
            height: 1.3rem;
            top: 0.05rem;
            right: 0.05rem;
            position: absolute;
            color: red;
          }
          &-des {
            flex: 2;
            flex-direction: column;
            text-align: left;
            overflow: hidden;
            gap: 1rem;
            &-title {
              font-weight: bold;
            }
            &-remark {
              color: var(--font-hint-color);
            }
          }
          &-btn {
            flex: 1;
          }
        }

        &-grid {
          display: flex;
          flex-direction: row;
          flex-wrap: wrap;
          width: 100%;
        }
        /* 宫格样式 */
        &-item2 {
          display: flex;
          align-items: center;
          position: relative;
          flex-direction: column;
          box-sizing: border-box;
          padding: 0.5rem 1rem;
          margin-bottom: 0.5rem;
          width: 33.33%;
          height: 8rem;

          &-des {
            font-weight: bold;
          }
          &-img {
            z-index: 1;
            width: 100%;
            height: 100%;
          }
          &-del {
            width: 1.3rem;
            height: 1.3rem;
            top: 0.05rem;
            right: 0.05rem;
            position: absolute;
            color: red;
            z-index: 999;
          }
        }
        &-add {
          @include innerdashedBorder();
          display: flex;
          align-items: center;
          justify-content: center;
          cursor: pointer;
          &-icon {
            width: 1rem;
            height: 1rem;
          }
        }
      }
      &-right {
        flex: 3;
        background-color: white;
        height: 100%;
        overflow-y: auto;
        @include scollBarStyle();
      }
    }

    //步骤一
    &-layout {
      display: flex;
      justify-content: space-around;
      background-color: var(--divider-color);
      box-sizing: border-box;
      padding: 1rem;
      margin: 2rem 0;
      height: 30rem;
      &-item {
        background-color: rgb(245, 245, 245);
        padding: 1rem;
        border-radius: 6px;
        box-shadow: 0 0 5px transparent;
        &-img {
          width: 100%;
          background-color: antiquewhite;
        }
      }
      &-item:hover {
        box-shadow: 0 0 5px var(--primary-main-color);
      }
      &-checked {
        box-shadow: 0 0 10px var(--primary-main-color);
      }
    }

    //头部step
    &-header {
      display: flex;
      align-items: center;
      &-title {
        flex: 2;
        &-icon {
          font-size: 0.6rem;
          display: inline-flex;
          border-radius: 10rem;
          width: 0.8rem;
          height: 0.8rem;
          padding: 0.08rem;
          align-items: center;
          justify-content: center;
          border: 1px solid var(--font-hint-color);
        }
      }
      &-divider {
        flex: 1;
        height: 1px;
        border-top: 1px dashed var(--divider-color);
      }
    }
  }
  /* table */
  &-table {
    @include dashedBorder();
    &-title {
      width: 100%;
      color: var(--font-hint-color);
      font-size: var(--font-title-size);
      text-align: left;
    }
    &-row {
      display: flex;
      width: 100%;
      border-top: 1px solid var(--divider-color);
      border-left: 1px solid var(--divider-color);

      &-pop {
        display: flex;
        justify-content: space-around;
        &-icon {
          width: 1.5rem;
          // height: 1.5rem;
          border: 1px dashed var(--divider-color);
          // background-color: aqua;
        }
        &-icon:hover{
          color: var(--primary-main-color);
          border:1px solid var(--primary-main-color);
        }
      }

      &-header {
        font-weight: bold;
      }
      &-body {
        font-weight: 500;
      }

      &-cell {
        flex: 1;
        border-right: 1px solid var(--divider-color);
        border-bottom: 1px solid var(--divider-color);
        overflow: hidden;
        &-input {
          .el-input__wrapper {
            box-shadow: unset;
          }
        }
      }
    }
  }
  /* swiper */
  &-swiper {
    @include dashedBorder();
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    &-hint {
      width: 26rem;
      word-wrap: break-word;
      color: var(--font-hint-color);
    }
    &-nodata {
      width: 3rem;
      height: 3rem;
      margin-right: 8px;
      color: var(--font-hint-color);
      border: 0.16rem solid var(--font-hint-color);
      border-radius: 5px;
      padding: 10px;
    }
    &-data {
      width: 100%;
      display: flex;
      flex-direction: row;
      flex-wrap: wrap;
      gap: 0.1rem;
      &-item {
        width: 33%;
        margin: 0 0 1rem 0;
      }
    }
  }
  /* name */
  &-name {
    text-align: center;
    width: 100%;
    &-input {
      width: 8rem;
      .el-input__wrapper {
        box-shadow: unset;
      }
    }
    &-hint {
      width: 100%;
      color: var(--font-hint-color);
      text-align: center;
    }
  }
  /* map */
  &-map {
    @include dashedBorder();
    cursor: pointer;
  }

  /* file */
  &-file {
    @include dashedBorder();
    cursor: pointer;

    &-scroll {
      height: 440px;
      overflow-y: auto;
      box-sizing: border-box;
      @include scollBarStyle();
    }

    &-item{
      display: flex;
      margin-bottom: 1.5rem;
      &-left{
        flex: 1;
        padding: 1rem;
        background-color: var(--divider-color);
      }
      &-right{
        width: 5rem;
        display: flex;
        align-items: center;
        justify-content: space-around;
        &-icon{
          width: 5rem;
          height: 5rem;
          border: 1px dashed var(--divider-color);
          &:hover{
            color: var(--primary-main-color);
            cursor: pointer;
            border: 1px solid var(--primary-main-color);
          }
        }

      }
    }
  }
}
